<!--

    Copyright (C) 2015 The Gravitee team (http://gravitee.io)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<div class="promotion-task">
  <div class="promotion-task__header">
    <div class="promotion-task__header__left">
      <gv-icon class="promotion-task__header__left__icon" shape="maps:rocket"></gv-icon>
      <div class="promotion-task__header__left__title">API Promotion Request</div>
    </div>
    <div class="promotion-task__header__right">
      <div class="promotion-task__header__right__date">{{$ctrl.task.created_at | humanDatetimeFilter}}</div>
    </div>
  </div>

  <div class="promotion-task__description">
    <div>
      <strong>{{:: $ctrl.task.data.authorDisplayName}}</strong> requested the promotion of API
      <code>{{::$ctrl.task.data.apiName}}</code> from environment <strong>{{::$ctrl.task.data.sourceEnvironmentName}}</strong> to
      environment <strong>{{::$ctrl.task.data.targetEnvironmentName}}</strong>
    </div>
    <div class="promotion-task__description__details">
      <div ng-if="$ctrl.task.data.isApiUpdate">
        Since the API has already been promoted to this environment, accepting this promotion will update the existing API.
      </div>
      <div ng-if="!$ctrl.task.data.isApiUpdate">Accepting this promotion will create a new API in the specified environment.</div>
    </div>
  </div>

  <div class="promotion-task__actions">
    <div class="promotion-task__actions__reject">
      <md-button ng-click="$ctrl.openRejectDialog()"><gv-icon shape="content:clear"></gv-icon>REJECT</md-button>
    </div>
    <div class="promotion-task__actions__accept">
      <md-button ng-click="$ctrl.openAcceptDialog()"><gv-icon shape="action:done"></gv-icon>ACCEPT</md-button>
    </div>
  </div>
</div>
